package day0401;

import java.util.Arrays;
import java.util.Scanner;

public class XingYe {
    /**
     * 数组中的最长山脉:力扣原题  推理
     */
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] arr = Arrays.stream(sc.nextLine().split(",")).map(Integer::parseInt).mapToInt(Integer::intValue).toArray();
        System.out.println(maxLongMountain(arr));


    }

    private static int maxLongMountain(int arr[]) {
        int ans = 0;
        if (arr.length == 0) {
            return 0;
        }
        int[] left = new int[arr.length];
        for (int i = 1; i < arr.length; i++) {
            left[i] = arr[i - 1] < arr[i] ? left[i - 1] + 1 : 0;
        }
        int[] right = new int[arr.length];
        for (int i = arr.length - 2; i >= 0; i--) {
            right[i] = arr[i + 1] < arr[i] ? right[i + 1] + 1 : 0;
        }
        for (int i = 0; i < arr.length; i++) {
            if (left[i] > 0 && right[i] > 0) {
                ans = Math.max(ans, left[i] + right[i] + 1);
            }
        }
        return ans;

    }


}

